import { SYSTEM } from '../api'
import { METHOD, request } from '@/utils/request'

/* 字典相关 */
// 新增
export async function addDict(params) {
    return request(`${SYSTEM}/dict/save`, METHOD.POST, params)
}
// 删除
export async function delDict(params) {
    return request(`${SYSTEM}/dict/del`, METHOD.POST, params)
}
// 批量删除
export async function delDictList(params) {
    return request(`${SYSTEM}/dict/batchDel`, METHOD.POST, params)
}
// 修改
export async function updateDict(params) {
    return request(`${SYSTEM}/dict/update`, METHOD.POST, params)
}
// 查询目录
export async function getDictCatalogue(params) {
    return request(`${SYSTEM}/dict/catalogue`, METHOD.POST, params)
}
// 查询列表
export async function getDictList(params) {
    return request(`${SYSTEM}/dict/page`, METHOD.POST, params)
}
// 查询单个详情
export async function getDictDetail(params) {
    return request(`${SYSTEM}/dict/get`, METHOD.POST, params)
}
// 查询特定目录的集合
export async function getDictByFlag(params) {
    return request(`${SYSTEM}/dict/query`, METHOD.POST, params)
}

export default {
    addDict,
    delDict,
    delDictList,
    updateDict,
    getDictCatalogue,
    getDictList,
    getDictDetail,
    getDictByFlag
}